<?php

// UBAH FORMAT d/m/Y ke Y-m-d
function ID_DateToMySQL($strDate)
{
	$strDateList = explode('/',$strDate);
	return $strDateList[2] . '-' . $strDateList[1] . '-' . $strDateList[0];
}

function month_range($d1,$d2,$sql=FALSE){
	$start = $month = strtotime($d1);
	$end = strtotime($d2);
	$months = array();
	while($month < $end)
	{
	     $months[] = $sql ? date('Y-m', $month) : date('M', $month);
	     $month = strtotime("+1 month", $month);
	}
	return $months;	  
}